<include file="./Template/Admin/header.html" title="产品栏目列表" />
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>产品栏目列表</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="row m-b-sm m-t-sm">
                            <div class="col-md-2">
                                <a href="{:U('Admin/Category/add')}" class="btn btn-outline btn-primary">添加产品栏目</a>
                            </div>
                        </div>
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>栏目名称</th>
                                    <th>英文名称</th>
                                    <th>SEO标题</th>
                                    <th>SEO关键词</th>
                                    <th>SEO描述</th>
                                    <th>排序</th>
                                    <th>状态</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody id="pageView">
                                <volist name="list" id="v">
                                    <tr>
                                        <td>{$v.id}</td>
                                        <td>{$v.html}{$v.title}</td>
                                        <td>{$v.columns}</td>
                                        <td>{$v.seo_title}</td>
                                        <td>{$v.seo_keyword}</td>
                                        <td>{$v.seo_description}</td>
                                        <td>{$v.px}</td>
                                        <td>
                                            <if condition="v.status">
                                                <a href="javascript:statusChange({$v.id});" class="btn btn-outline btn-sm btn-primary" id="status{$v.id}">正常</a>
                                            <else />
                                                <a href="javascript:statusChange({$v.id});" class="btn btn-outline btn-sm btn-danger" id="status{$v.id}">禁用</a>
                                            </if>
                                        </td>
                                        <td>
                                            <div class="col-md-12">
                                                <a class="btn btn-sm btn-outline btn-warning" href="{:U('Admin/Category/add/pid/'.$v['id'])}"><i class="fa fa-edit"></i>添加子栏目</a>
                                                <a class="btn btn-sm btn-outline btn-warning" href="{:U('Admin/Category/edit/id/'.$v['id'])}"><i class="fa fa-edit"></i> 修改</a>
                                                <a class="btn btn-sm btn-outline btn-danger" href="javascript:del({$v.id})"><i class="fa fa-trash-o"></i> 删除</a>
                                            </div>
                                        </td>
                                    </tr>
                                </volist>
                            </tbody>
                        </table>
                        <!--laypage 分页-->
                        <div id="pageList" style="text-align: center;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="__ADMIN__js/jquery.min.js"></script>
    <script src="__ADMIN__js/bootstrap.min.js"></script>
    <script src="__ADMIN__js/plugins/layer.3/layer.js"></script>
    <script src="__ADMIN__js/plugins/laypage/laypage.js"></script>
    <script src="__ADMIN__js/common.js"></script>

    <script>
        $(function(){
            /**
             * 更改管理员状态
             */
            statusChange = function(id){
                common.ajaxStatusChange("{:U('Admin/Category/statusChange')}", id, $('#status' + id));
            };

            /**
             * 删除管理员
             * @param id
             */
            del = function(id){
                common.ajaxDel("{:U('Admin/Category/del')}",id,"{:U('Admin/Category/index')}");
            };

        });
    </script>
</body>
</html>
